package com.lyy.consolidate;


/**
 * @Author:  GZQ
 * @date:  2024/12/2 22:16
 * @description: 巩固练习6
 */

public class BlankAccount { // 父类

    private double balance; // 余额

    public BlankAccount(double initialbalance) {
        this.balance = initialbalance;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    // 存钱
    public void deposit(double amount) {
        balance += amount;
    }

    // 取钱
    public void withdraw(double amount) {
        balance -= amount;
    }
}
